import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'index',
    },
    {
      path: '/noAuthority',
      name: 'noAuthority',
      component: resolve => require(['@/views/noAuthority.vue'], resolve)
    },
    // 看板设置
    {
      path: '/boardsetup',
      name: 'boardsetup',
      redirect: { name: 'panoramaSetup' },
      component: resolve => require(['@/views/boardsetup/index.vue'], resolve),
      children: [
        {
          // 全景图设置
          path: 'panoramaSetup',
          name: 'panoramaSetup',
          component: resolve => require(['@/views/boardsetup/panoramaSetup/index.vue'], resolve)
        },
        {
          // 数据填报
          path: 'info',
          name: 'info',
          redirect: {name: 'projectStatus'},
          component: resolve => require(['@/views/boardsetup/info/index.vue'], resolve),
          children: [
            {
              // 工程信息
              path: 'projectStatus',
              name: 'projectStatus',
              component: resolve => require(['@/views/boardsetup/info/projectStatus.vue'], resolve)
            },
            {
              // 质量安全
              path: 'qualitySafe',
              name: 'qualitySafe',
              component: resolve => require(['@/views/boardsetup/info/qualitySafe.vue'], resolve)
            },
            {
              // 大屏参数
              path: 'screenInfo',
              name: 'screenInfo',
              component: resolve => require(['@/views/boardsetup/info/screenInfo.vue'], resolve)
            }
          ]
        }
      ]
    },
    // 视频监测
    {
      path: '/videoMonitor',
      name: 'videoMonitor',
      component: resolve => require(['@/views/video/index.vue'], resolve),
      children: [
        {
          // 企业级
          path: 'companyVideo',
          name: 'companyVideo',
          component: resolve => require(['@/views/video/company/company.vue'], resolve)
        },
        {
          path: 'areaVideo',
          name: 'areaVideo',
          component: resolve => require(['@/views/video/company/area.vue'], resolve)
        },
        {
          // 项目级
          path: 'projectVideo',
          name: 'projectVideo',
          component: resolve => require(['@/views/video/project/index.vue'], resolve)
        }
      ]
    },
    // 塔吊监测
    {
      path: '/tcMonitor',
      name: 'tcMonitor',
      component: resolve => require(['@/views/tower/index.vue'], resolve),
      children: [
        {
          // 企业级
          path: 'companyTower',
          name: 'companyTower',
          component: resolve => require(['@/views/tower/company/company.vue'], resolve)
        },
        {
          path: 'areaTower',
          name: 'areaTower',
          component: resolve => require(['@/views/tower/company/area.vue'], resolve)
        },
        {
          // 项目级
          path: 'projectTower',
          name: 'projectTower',
          component: resolve => require(['@/views/tower/project/index.vue'], resolve)
        },
        {
          // 监控记录
          path: 'towerProjectRecord',
          name: 'towerProjectRecord',
          component: resolve => require(['@/views/tower/project/projectRecord.vue'], resolve)
        },
        {
          // 每个塔吊的数据统计
          path: 'eachTowerRecord',
          name: 'eachTowerRecord',
          component: resolve => require(['@/views/tower/project/eachTowerRecord.vue'], resolve)
        },
        {
          // 所有塔吊的数据统计
          path: 'allTowerRecord',
          name: 'allTowerRecord',
          component: resolve => require(['@/views/tower/project/allTowerRecord.vue'], resolve)
        }
      ]
    },
    // 升降机监测
    {
      path: '/liftMonitor',
      name: 'elevator',
      component: resolve => require(['@/views/elevator/index.vue'], resolve),
      children: [
        {
          // 企业级
          path: 'companyElevator',
          name: 'companyElevator',
          component: resolve => require(['@/views/elevator/company/company.vue'], resolve)
        },
        {
          path: 'areaElevator',
          name: 'areaElevator',
          component: resolve => require(['@/views/elevator/company/area.vue'], resolve)
        },
        {
          // 项目级
          path: 'projectElevator',
          name: 'projectElevator',
          component: resolve => require(['@/views/elevator/project/index.vue'], resolve)
        },
        {
          // 监控记录
          path: 'elevatorProjectRecord',
          name: 'elevatorProjectRecord',
          component: resolve => require(['@/views/elevator/project/projectRecord.vue'], resolve)
        },
        {
          // 每个塔吊的数据统计
          path: 'eachElevatorRecord',
          name: 'eachElevatorRecord',
          component: resolve => require(['@/views/elevator/project/eachElevatorRecord.vue'], resolve)
        },
        {
          // 所有塔吊的数据统计
          path: 'allElevatorRecord',
          name: 'allElevatorRecord',
          component: resolve => require(['@/views/elevator/project/allElevatorRecord.vue'], resolve)
        }
      ]
    },
    // 环境监测
    {
      path: '/envMonitor',
      name: 'envMonitor',
      component: resolve => require(['@/views/environment/index.vue'], resolve),
      children: [
        {
          path: 'companyEnvironment',
          name: 'companyEnvironment',
          component: resolve => require(['@/views/environment/company/index.vue'], resolve)
        },
        {
          path: 'areaEnvironment',
          name: 'areaEnvironment',
          component: resolve => require(['@/views/environment/company/area.vue'], resolve)
        },
        {
          path: 'projectEnvironment',
          name: 'projectEnvironment',
          component: resolve => require(['@/views/environment/project/index.vue'], resolve)
        },
        {
          path: 'projectDetailEnvironment',
          name: 'projectDetailEnvironment',
          component: resolve => require(['@/views/environment/project/more/detail.vue'], resolve)
        }
      ]
    }
  ]
})

export default router
